<template>
  <div id="HistoryDetails" class="mainContent">
    <div class="historyDetailsCon" v-if="history.length">
      <h2 class="title">{{lllnessDetails.Time_Record |filterDateT}}<span>&nbsp;</span><span>{{lllnessDetails.Name}}</span></h2>
      <textarea class="historyDetailsText" readonly>
        {{lllnessDetails.TXT}}
      </textarea>
    </div>
    <Loading v-if="!history.length"></Loading>
  </div>
</template>
<script>
  import { apiCaseOfLllnessDetails } from '@/api/api'
  import Loading from "@/components/loading/loading"  //导入loading组件
  export default {
    data() {
      return {
        history:[],
        lllnessDetails: {},
      }
    },
    mounted() {
      //this.getCaseOfLllnessDetails()
    },
    activated() {
      this.getCaseOfLllnessDetails()
    },
    methods: {
      getCaseOfLllnessDetails() {
        this.history = [];
        apiCaseOfLllnessDetails({
          patientID: this.$store.getters.ID,
          CaseOfLllnessID: this.$route.params.caseOfLllnessID
        })
          .then(res => {
            if (JSON.parse(res).Status == 1) {
              this.history = JSON.parse(res).Data;
              this.lllnessDetails = JSON.parse(res).Data[0];
              //console.log(this.lllnessDetails)
            }
          })
          .catch(err => {
            reject(err.data);
          });
      }
    },
    components: {
      Loading
    }
  }
</script>
<style scoped>
  #HistoryDetails {
    padding: 35px 50px;
  }

  .historyDetailsCon {
    height: 100%;
    width: 100%;
  }

  .title {
    font-size: 18px;
    color: #000;
  }

    .title span {
      margin-right: 15px;
    }

  .historyDetailsText {
    margin-top: 20px;
    width: 100%;
    height: 95%;
    overflow-x: hidden;
    font-size: 14px;
    border: 0;
    resize: none;
  }
  @media screen and (max-width: 768px) {
    #HistoryDetails {
    padding: 35px 15px;
  }
}
@media screen and (max-width: 425px) {
}
</style>
